<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <title>index</title>
</head>
<body>
<div id="app">
  <button v-on:click="hello">点击按钮</button>
  <button @click="study">去学习</button>
  <!--方法没有参数时, 括号可以写也可以不写-->
  <button @click="study()">去学习</button>
  <!--方法有参数时,传参一定要写括号-->
  <button @click="sing('小星星')">去唱歌</button>
</div>
<script src="vue.js"></script>
<script>
  new Vue({
    el: '#app',
    methods: {  // 注意是methods ssssssssssssssssssssssssssss
      hello() {
        alert('hello vue')
      },
      study() {
        alert('hello vue')
      },
      sing(title) {
        alert('我在唱: ' + title)
      }
    }
  })
</script>
</body>
</html>